package com.fable.ntzw_ga.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fable.common.vo.PageVO;
import com.fable.ntzw_ga.entity.Dept;
import com.fable.ntzw_ga.mapper.DeptMapper;
import com.fable.ntzw_ga.service.IDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.graphbuilder.struc.LinkedList;
import org.springframework.stereotype.Service;

/**
 * @author Created by gzh 2023-02-03 12:41:05
 */
@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {

    @Override
    public IPage<Dept> getPage(PageVO pageVO,Dept dept) {
        LambdaQueryWrapper<Dept> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(Dept::getName,dept.getName());
//        return pageVO.getPageList(baseMapper.selectList(wrapper));
        return baseMapper.selectPage(new Page<>(pageVO.getCurrent(),pageVO.getSize()),wrapper);
    }
}
